home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / Editions.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  9.5 KB  |  503 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Editions.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__EDITIONS__') = 'UNDEFINED' THEN
  18. __EDITIONS__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__MEMORY__') = 'UNDEFINED' THEN
  22.     include 'Memory.a'
  23.     ENDIF
  24. ;        include 'Types.a'                                            ;
  25. ;            include 'ConditionalMacros.a'                            ;
  26. ;        include 'MixedMode.a'                                        ;
  27.  
  28.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  29.     include 'Files.a'
  30.     ENDIF
  31. ;        include 'OSUtils.a'                                        ;
  32.  
  33.     IF &TYPE('__ALIASES__') = 'UNDEFINED' THEN
  34.     include 'Aliases.a'
  35.     ENDIF
  36. ;        include 'AppleTalk.a'                                        ;
  37.  
  38.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  39.     include 'Dialogs.a'
  40.     ENDIF
  41. ;        include 'Errors.a'                                            ;
  42. ;        include 'Windows.a'                                        ;
  43. ;            include 'Quickdraw.a'                                    ;
  44. ;                include 'QuickdrawText.a'                            ;
  45. ;            include 'Events.a'                                        ;
  46. ;            include 'Controls.a'                                    ;
  47. ;                include 'Menus.a'                                    ;
  48. ;        include 'TextEdit.a'                                        ;
  49.  
  50. ; resource types  
  51. rSectionType                    EQU        'sect'                ; ResType of saved SectionRecords 
  52. ; Finder types for edition files 
  53. kPICTEditionFileType            EQU        'edtp'
  54. kTEXTEditionFileType            EQU        'edtt'
  55. ksndEditionFileType                EQU        'edts'
  56. kUnknownEditionFileType            EQU        'edtu'
  57. kPublisherDocAliasFormat        EQU        'alis'
  58. kPreviewFormat                    EQU        'prvw'
  59. kFormatListFormat                EQU        'fmts'
  60.  
  61. ; section types 
  62. stSubscriber                    EQU        $01
  63. stPublisher                        EQU        $0A
  64. sumAutomatic                    EQU        0                    ; subscriber update mode - Automatically     
  65. sumManual                        EQU        1                    ; subscriber update mode - Manually 
  66. pumOnSave                        EQU        0                    ; publisher update mode - OnSave            
  67. pumManual                        EQU        1                    ; publisher update mode - Manually 
  68. kPartsNotUsed                    EQU        0
  69. kPartNumberUnknown                EQU        -1                    ; misc 
  70. kPreviewWidth                    EQU        120
  71. kPreviewHeight                    EQU        120
  72. ; bits for formatsMask 
  73. kPICTformatMask                    EQU        1
  74. kTEXTformatMask                    EQU        2
  75. ksndFormatMask                    EQU        4
  76. ; pseudo-item hits for dialogHooks 
  77. ; the first if for NewPublisher or NewSubscriber Dialogs 
  78. emHookRedrawPreview                EQU        150
  79. ; the following are for SectionOptions Dialog 
  80. emHookCancelSection                EQU        160
  81. emHookGoToPublisher                EQU        161
  82. emHookGetEditionNow                EQU        162
  83. emHookSendEditionNow            EQU        162
  84. emHookManualUpdateMode            EQU        163
  85. emHookAutoUpdateMode            EQU        164
  86.  
  87. ; the refcon field of the dialog record during a modalfilter 
  88. ; or dialoghook contains one the following 
  89. emOptionsDialogRefCon            EQU        'optn'
  90. emCancelSectionDialogRefCon        EQU        'cncl'
  91. emGoToPubErrDialogRefCon        EQU        'gerr'
  92. kFormatLengthUnknown            EQU        -1
  93.  
  94. ; one byte, stSubscriber or stPublisher 
  95. ; seconds since 1904 
  96. ; similar to ResType 
  97. ; used in Edition I/O 
  98. ; update modes 
  99. ; sumAutomatic, pumSuspend, etc 
  100. SectionRecord             RECORD    0
  101. version                     ds.b    1                                    ; always 0x01 in system 7.0 
  102. kind                     ds.b    1                                    ; stSubscriber or stPublisher 
  103. mode                     ds.w    1                                    ; auto or manual 
  104. mdDate                     ds.l    1                                    ; last change in document 
  105. sectionID                 ds.l    1                                    ; app. specific, unique per document 
  106. refCon                     ds.l    1                                    ; application specific 
  107. alias                     ds.l    1                                    ; handle to Alias Record 
  108. subPart                     ds.l    1                                    ; which part of container file 
  109. nextSection                 ds.l    1                                    ; for linked list of app's Sections 
  110. controlBlock             ds.l    1                                    ; used internally 
  111. refNum                     ds.l    1                                    ; used internally 
  112. sizeof                     EQU    36
  113.                         ENDR
  114.  
  115. EditionContainerSpec     RECORD    0
  116. theFile                     ds        FSSpec
  117. theFileScript             ds.w    1
  118. thePart                     ds.l    1
  119. thePartName                 ds.l    8
  120. thePartScript             ds.w    1
  121. sizeof                     EQU    110
  122.                         ENDR
  123.  
  124. EditionInfoRecord         RECORD    0
  125. crDate                     ds.l    1                                    ; date EditionContainer was created 
  126. mdDate                     ds.l    1                                    ; date of last change 
  127. fdCreator                 ds.l    1                                    ; file creator 
  128. fdType                     ds.l    1                                    ; file type 
  129. container                 ds        EditionContainerSpec                ; the Edition 
  130. sizeof                     EQU    126
  131.                         ENDR
  132.  
  133. NewPublisherReply         RECORD    0
  134. canceled                 ds.b    1                                    ; O 
  135. replacing                 ds.b    1
  136. usePart                     ds.b    1                                    ; I 
  137. filler                     ds.b    1
  138. preview                     ds.l    1                                    ; I 
  139. previewFormat             ds.l    1                                    ; I 
  140. container                 ds        EditionContainerSpec                ; I/O 
  141. sizeof                     EQU    122
  142.                         ENDR
  143.  
  144. NewSubscriberReply         RECORD    0
  145. canceled                 ds.b    1                                    ; O 
  146. formatsMask                 ds.b    1
  147. container                 ds        EditionContainerSpec                ;I/O
  148. sizeof                     EQU    112
  149.                         ENDR
  150.  
  151. SectionOptionsReply     RECORD    0
  152. canceled                 ds.b    1                                    ; O 
  153. changed                     ds.b    1                                    ; O 
  154. sectionH                 ds.l    1                                    ; I 
  155. action                     ds.l    1                                    ; O 
  156. sizeof                     EQU    10
  157.                         ENDR
  158.  
  159.  
  160. ioHasFormat                        EQU        0
  161. ioReadFormat                    EQU        1
  162. ioNewFormat                        EQU        2
  163. ioWriteFormat                    EQU        3
  164.  
  165. eoOpen                            EQU        0
  166. eoClose                            EQU        1
  167. eoOpenNew                        EQU        2
  168. eoCloseNew                        EQU        3
  169. eoCanSubscribe                    EQU        4
  170.  
  171. FormatIOParamBlock         RECORD    0
  172. ioRefNum                 ds.l    1
  173. format                     ds.l    1
  174. formatIndex                 ds.l    1
  175. offset                     ds.l    1
  176. buffPtr                     ds.l    1
  177. buffLen                     ds.l    1
  178. sizeof                     EQU    24
  179.                         ENDR
  180.  
  181. EditionOpenerParamBlock RECORD    0
  182. info                     ds        EditionInfoRecord
  183. sectionH                 ds.l    1
  184. document                 ds.l    1
  185. fdCreator                 ds.l    1
  186. ioRefNum                 ds.l    1
  187. ioProc                     ds.l    1
  188. success                     ds.b    1
  189. formatsMask                 ds.b    1
  190. sizeof                     EQU    148
  191.                         ENDR
  192.  
  193.  
  194. sectionEventMsgClass            EQU        'sect'
  195. sectionReadMsgID                EQU        'read'
  196. sectionWriteMsgID                EQU        'writ'
  197. sectionScrollMsgID                EQU        'scrl'
  198. sectionCancelMsgID                EQU        'cncl'
  199.  
  200. currentEditionMgrVers            EQU        $0011
  201.  
  202.     IF GENERATING68K THEN
  203.         Macro
  204.         _InitEditionPackVersion
  205.             move.w    #$0100,d0
  206.             dc.w     $A82D
  207.         EndM
  208.     ELSE
  209.         IMPORT    InitEditionPackVersion
  210.     ENDIF
  211.  
  212.     IF GENERATING68K THEN
  213.         Macro
  214.         _NewSection
  215.             move.w    #$0A02,d0
  216.             dc.w     $A82D
  217.         EndM
  218.     ELSE
  219.         IMPORT    NewSection
  220.     ENDIF
  221.  
  222.     IF GENERATING68K THEN
  223.         Macro
  224.         _RegisterSection
  225.             move.w    #$0604,d0
  226.             dc.w     $A82D
  227.         EndM
  228.     ELSE
  229.         IMPORT    RegisterSection
  230.     ENDIF
  231.  
  232.     IF GENERATING68K THEN
  233.         Macro
  234.         _UnRegisterSection
  235.             move.w    #$0206,d0
  236.             dc.w     $A82D
  237.         EndM
  238.     ELSE
  239.         IMPORT    UnRegisterSection
  240.     ENDIF
  241.  
  242.     IF GENERATING68K THEN
  243.         Macro
  244.         _IsRegisteredSection
  245.             move.w    #$0208,d0
  246.             dc.w     $A82D
  247.         EndM
  248.     ELSE
  249.         IMPORT    IsRegisteredSection
  250.     ENDIF
  251.  
  252.     IF GENERATING68K THEN
  253.         Macro
  254.         _AssociateSection
  255.             move.w    #$040C,d0
  256.             dc.w     $A82D
  257.         EndM
  258.     ELSE
  259.         IMPORT    AssociateSection
  260.     ENDIF
  261.  
  262.     IF GENERATING68K THEN
  263.         Macro
  264.         _CreateEditionContainerFile
  265.             move.w    #$050E,d0
  266.             dc.w     $A82D
  267.         EndM
  268.     ELSE
  269.         IMPORT    CreateEditionContainerFile
  270.     ENDIF
  271.  
  272.     IF GENERATING68K THEN
  273.         Macro
  274.         _DeleteEditionContainerFile
  275.             move.w    #$0210,d0
  276.             dc.w     $A82D
  277.         EndM
  278.     ELSE
  279.         IMPORT    DeleteEditionContainerFile
  280.     ENDIF
  281.  
  282.     IF GENERATING68K THEN
  283.         Macro
  284.         _OpenEdition
  285.             move.w    #$0412,d0
  286.             dc.w     $A82D
  287.         EndM
  288.     ELSE
  289.         IMPORT    OpenEdition
  290.     ENDIF
  291.  
  292.     IF GENERATING68K THEN
  293.         Macro
  294.         _OpenNewEdition
  295.             move.w    #$0814,d0
  296.             dc.w     $A82D
  297.         EndM
  298.     ELSE
  299.         IMPORT    OpenNewEdition
  300.     ENDIF
  301.  
  302.     IF GENERATING68K THEN
  303.         Macro
  304.         _CloseEdition
  305.             move.w    #$0316,d0
  306.             dc.w     $A82D
  307.         EndM
  308.     ELSE
  309.         IMPORT    CloseEdition
  310.     ENDIF
  311.  
  312.     IF GENERATING68K THEN
  313.         Macro
  314.         _EditionHasFormat
  315.             move.w    #$0618,d0
  316.             dc.w     $A82D
  317.         EndM
  318.     ELSE
  319.         IMPORT    EditionHasFormat
  320.     ENDIF
  321.  
  322.     IF GENERATING68K THEN
  323.         Macro
  324.         _ReadEdition
  325.             move.w    #$081A,d0
  326.             dc.w     $A82D
  327.         EndM
  328.     ELSE
  329.         IMPORT    ReadEdition
  330.     ENDIF
  331.  
  332.     IF GENERATING68K THEN
  333.         Macro
  334.         _WriteEdition
  335.             move.w    #$081C,d0
  336.             dc.w     $A82D
  337.         EndM
  338.     ELSE
  339.         IMPORT    WriteEdition
  340.     ENDIF
  341.  
  342.     IF GENERATING68K THEN
  343.         Macro
  344.         _GetEditionFormatMark
  345.             move.w    #$061E,d0
  346.             dc.w     $A82D
  347.         EndM
  348.     ELSE
  349.         IMPORT    GetEditionFormatMark
  350.     ENDIF
  351.  
  352.     IF GENERATING68K THEN
  353.         Macro
  354.         _SetEditionFormatMark
  355.             move.w    #$0620,d0
  356.             dc.w     $A82D
  357.         EndM
  358.     ELSE
  359.         IMPORT    SetEditionFormatMark
  360.     ENDIF
  361.  
  362.     IF GENERATING68K THEN
  363.         Macro
  364.         _GetEditionInfo
  365.             move.w    #$0422,d0
  366.             dc.w     $A82D
  367.         EndM
  368.     ELSE
  369.         IMPORT    GetEditionInfo
  370.     ENDIF
  371.  
  372.     IF GENERATING68K THEN
  373.         Macro
  374.         _GoToPublisherSection
  375.             move.w    #$0224,d0
  376.             dc.w     $A82D
  377.         EndM
  378.     ELSE
  379.         IMPORT    GoToPublisherSection
  380.     ENDIF
  381.  
  382.     IF GENERATING68K THEN
  383.         Macro
  384.         _GetLastEditionContainerUsed
  385.             move.w    #$0226,d0
  386.             dc.w     $A82D
  387.         EndM
  388.     ELSE
  389.         IMPORT    GetLastEditionContainerUsed
  390.     ENDIF
  391.  
  392.     IF GENERATING68K THEN
  393.         Macro
  394.         _GetStandardFormats
  395.             move.w    #$0A28,d0
  396.             dc.w     $A82D
  397.         EndM
  398.     ELSE
  399.         IMPORT    GetStandardFormats
  400.     ENDIF
  401.  
  402.     IF GENERATING68K THEN
  403.         Macro
  404.         _GetEditionOpenerProc
  405.             move.w    #$022A,d0
  406.             dc.w     $A82D
  407.         EndM
  408.     ELSE
  409.         IMPORT    GetEditionOpenerProc
  410.     ENDIF
  411.  
  412.     IF GENERATING68K THEN
  413.         Macro
  414.         _SetEditionOpenerProc
  415.             move.w    #$022C,d0
  416.             dc.w     $A82D
  417.         EndM
  418.     ELSE
  419.         IMPORT    SetEditionOpenerProc
  420.     ENDIF
  421.  
  422.     IF GENERATING68K THEN
  423.         Macro
  424.         _CallEditionOpenerProc
  425.             move.w    #$052E,d0
  426.             dc.w     $A82D
  427.         EndM
  428.     ELSE
  429.         IMPORT    CallEditionOpenerProc
  430.     ENDIF
  431.  
  432.     IF GENERATING68K THEN
  433.         Macro
  434.         _CallFormatIOProc
  435.             move.w    #$0530,d0
  436.             dc.w     $A82D
  437.         EndM
  438.     ELSE
  439.         IMPORT    CallFormatIOProc
  440.     ENDIF
  441.  
  442.     IF GENERATING68K THEN
  443.         Macro
  444.         _NewSubscriberDialog
  445.             move.w    #$0232,d0
  446.             dc.w     $A82D
  447.         EndM
  448.     ELSE
  449.         IMPORT    NewSubscriberDialog
  450.     ENDIF
  451.  
  452.     IF GENERATING68K THEN
  453.         Macro
  454.         _NewSubscriberExpDialog
  455.             move.w    #$0B34,d0
  456.             dc.w     $A82D
  457.         EndM
  458.     ELSE
  459.         IMPORT    NewSubscriberExpDialog
  460.     ENDIF
  461.  
  462.     IF GENERATING68K THEN
  463.         Macro
  464.         _NewPublisherDialog
  465.             move.w    #$0236,d0
  466.             dc.w     $A82D
  467.         EndM
  468.     ELSE
  469.         IMPORT    NewPublisherDialog
  470.     ENDIF
  471.  
  472.     IF GENERATING68K THEN
  473.         Macro
  474.         _NewPublisherExpDialog
  475.             move.w    #$0B38,d0
  476.             dc.w     $A82D
  477.         EndM
  478.     ELSE
  479.         IMPORT    NewPublisherExpDialog
  480.     ENDIF
  481.  
  482.     IF GENERATING68K THEN
  483.         Macro
  484.         _SectionOptionsDialog
  485.             move.w    #$023A,d0
  486.             dc.w     $A82D
  487.         EndM
  488.     ELSE
  489.         IMPORT    SectionOptionsDialog
  490.     ENDIF
  491.  
  492.     IF GENERATING68K THEN
  493.         Macro
  494.         _SectionOptionsExpDialog
  495.             move.w    #$0B3C,d0
  496.             dc.w     $A82D
  497.         EndM
  498.     ELSE
  499.         IMPORT    SectionOptionsExpDialog
  500.     ENDIF
  501.  
  502.     ENDIF ; __EDITIONS__
  503.